]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Stop using string concatenation
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 24 Mar 2020 04:02:20 +0000 (05:02 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 23 Feb 2022 12:23:52 +0000 (12:23 +0000)
It's unfortunate that we cannot fully embrace template strings, but
we aren't limited to "legacy" formatting either; replace the last
remaining places where we still use string concatenation to reduce
the difference between regular and legacy style a bit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2200>

js/gdm/vmware.js
js/ui/components/telepathyClient.js
js/ui/notificationDaemon.js
js/ui/padOsd.js
lint/eslintrc-legacy.yml

index 20d57e8a28f09534593fddd03b047bde3da3b5a3..fb80a78a22c5663419f5d929a08d43b50a3ed13e 100644 (file)
@@ -10,13 +10,13 @@ const dbusInterface = 'org.vmware.viewagent.Credentials';
 
 var SERVICE_NAME = 'gdm-vmwcred';
 
-const VmwareCredentialsIface = '<node> \
-<interface name="' + dbusInterface + '"> \
-<signal name="UserAuthenticated"> \
-    <arg type="s" name="token"/> \
-</signal> \
-</interface> \
-</node>';
+const VmwareCredentialsIface = `<node>
+<interface name="${dbusInterface}">
+<signal name="UserAuthenticated">
+    <arg type="s" name="token"/>
+</signal>
+</interface>
+</node>`;
 
 
 const VmwareCredentialsInfo = Gio.DBusInterfaceInfo.new_for_xml(VmwareCredentialsIface);
index 90c0cbdf421e839c7d18a6b213532b8538be4c8b..335f32a9adb1d19dc30cbb36a54f88067a68ce57 100644 (file)
@@ -816,7 +816,8 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({
 
         /* Translators: this is the other person changing their old IM name to their new
            IM name. */
-        let message = '<i>' + _("%s is now known as %s").format(oldAlias, newAlias) + '</i>';
+        const message = `<i>${
+            _('%s is now known as %s').format(oldAlias, newAlias)}</i>`;
 
         this._append({ body: message,
                        group: 'meta',
index c2645586f9bc8aeca14fb0ed167de0c2d86cae3d..4058ebdc390ad056d44983e6751c096e450e5cbe 100644 (file)
@@ -545,7 +545,7 @@ const FdoApplicationIface = loadInterfaceXML('org.freedesktop.Application');
 const FdoApplicationProxy = Gio.DBusProxy.makeProxyWrapper(FdoApplicationIface);
 
 function objectPathFromAppId(appId) {
-    return '/' + appId.replace(/\./g, '/').replace(/-/g, '_');
+    return `/${appId.replace(/\./g, '/').replace(/-/g, '_')}`;
 }
 
 function getPlatformData() {
index b58e4eeb464c91ddbe8f8b796412e4362ec82a69..98a028f667f921117cd136c003ebf361323837af 100644 (file)
@@ -359,9 +359,10 @@ var PadDiagram = GObject.registerClass({
     }
 
     _wrappingSvgFooter() {
-        return '</style>' +
-                '<xi:include href="' + this._imagePath + '" />' +
-                '</svg>';
+        return '%s%s%s'.format(
+            '</style>',
+            '<xi:include href="%s" />'.format(this._imagePath),
+            '</svg>');
     }
 
     _cssString() {
@@ -885,7 +886,7 @@ var PadOsd = GObject.registerClass({
         this._endActionEdition();
         this._editedAction = { type, number, dir, mode };
 
-        let settingsPath = this._settings.path + key + '/';
+        const settingsPath = `${this._settings.path}${key}/`;
         this._editedActionSettings = Gio.Settings.new_with_path('org.gnome.desktop.peripherals.tablet.pad-button',
                                                                 settingsPath);
         this._actionEditor.setSettings(this._editedActionSettings, type);
index 8441f7c2d5e4a51e0ec7b7a0d9e53bd2fcae2d63..e8a0e2935c884bef9164e779f9e1debd87cec44a 100644 (file)
@@ -24,5 +24,4 @@ rules:
   object-curly-newline:
     - error
     - consistent: true
-  prefer-template: off
   quotes: off